package com.heima.apis.schedule.fallback;

import com.heima.apis.schedule.IScheduleClient;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.common.enums.AppHttpCodeEnum;
import com.heima.model.schedule.dtos.Task;
import org.springframework.stereotype.Component;

/**
 * @author Xiao
 * @version 1.0
 * @description
 * @date 2021/11/28
 */
@Component
public class IScheduleClientFallback implements IScheduleClient {
    /**
     * 添加任务
     * @param task
     * @return
     */
    @Override
    public ResponseResult addTask(Task task) {
        return ResponseResult.errorResult(AppHttpCodeEnum.SERVER_ERROR,"获取数据失败");
    }

    /**
     * 取消任务
     * @param taskId
     * @return
     */
    @Override
    public ResponseResult cancelTask(Long taskId) {
        return ResponseResult.errorResult(AppHttpCodeEnum.SERVER_ERROR,"获取数据失败");
    }

    /**
     * 按照类型和优先级拉取任务
     * @param type
     * @param priority
     * @return
     */
    @Override
    public ResponseResult poll(Integer type, Integer priority) {
        return ResponseResult.errorResult(AppHttpCodeEnum.SERVER_ERROR,"获取数据失败");
    }
}
